package global

import (
	"MoSkeleton/config/consts"
	"MoSkeleton/framework"
	gorm2 "MoSkeleton/global/gorm"
	"go.uber.org/zap"
)

type CommonInitServices struct {
}

func (i *CommonInitServices) OnInitSystem() error {
	err := framework.MO_DBORM.Callback().Query().Before("gorm:query").Register(consts.GORM_CallBack_DataScope, gorm2.DoDataScopeBeforeQuery)
	if err != nil {
		MoLogger.Error("init db callback error", zap.Error(err))
	}

	return nil
}
